<!--  -->
<template>
  <div>
    <a-modal
        @cancel="modalClose"
        :visible="visible"
        width="60rem"
        tabindex="0"
        wrapClassName="chose-modal"
        :footer="null"
        :centered="true"
        @afterClose="afterClose"
    >
      <div class="course-list-wrap">
        <p
            class="course-item"
            v-for="item in courseList"
            :key="item.id"
            @click="courseClickHandle(item)"
        >
          {{ item.name }}
        </p>
      </div>
    </a-modal>
  </div>

</template>

<script>
import { Modal } from "ant-design-vue";
export default {
  name: "choseModal",
  components: {
    AModal: Modal,
  },
  data() {
    return {};
  },
  props: {
    visible: {
      type: Boolean,
      required: true,
    },
    courseList: {
      type: Array,
      default: () => {
        return [];
      },
    },
    courseClick: {
      type: Function,
    },
  },
  computed: {},
  watch: {},
  methods: {
    afterClose(){
      console.log('Modal has been closed.');
    },
    modalClose() {
      this.$emit("update:visible", false);
    },
    courseClickHandle(item) {
      this.$emit("courseClick", item);
    },
  },
  created() {},
  mounted() {},
};
</script>
<style  scoped>
/* @import url(); 引入公共css类 */
.course-list-wrap {
  padding: 40px 80px 20px;
  height: 313px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  .course-item {
    margin-bottom: 40px;
    cursor: pointer;
    font-size: 24px;
    &:nth-last-child(1) {
      margin-bottom: 0;
    }
    &:hover {
      color:#19C14B;
    }
  }
}
.ant-modal {
  z-index: 9999 !important;
}
</style>
